<template>
  <v-card flat class="mr-10 mb-4" :style="{position: 'relative', width: width + 'px'}">
    <router-link to="" class="cover" style="position: relative;">
      <div class="mask"></div>
      <v-img :src="film.pic"></v-img>
    </router-link>
    <v-list-item class="px-0">
      <v-list-item-content>
        <v-list-item-title>
          <router-link to="">{{ film.title }}</router-link>
        </v-list-item-title>
        <v-list-item-subtitle class="text-caption">{{ film.subtitle }}</v-list-item-subtitle>
      </v-list-item-content>
    </v-list-item>
    <slot name="top"></slot>
    <slot name="bottom"></slot>
  </v-card>
</template>

<script>
export default {
  name: "FilmCard",
  props: {
    film: {
      type: Object,
      required: true
    },
    width: {
      type: Number,
      required: false,
      default: 260
    },
  }
}
</script>

<style lang="less" scoped>
  .v-application a {
    color: #666;
  }
  .mask {
    /* 隐藏遮罩层 */
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: rgba(0,0,0,0.2) url('~@/assets/mask.png') center no-repeat;
    transition: all ease-out .35s;
  }
  .cover:hover .mask {
    display: block;
  }

</style>
